Skip to content

ModifyOrder not working as lastmodifiedtime is not set in the API code #2

@shahpareshr

Description

@shahpareshr

Setting od modifyOrderinfo.lastmodifiedtime is missing in the below code of ModifyOrder due to with ModifyOrder method always returns error.
as per the API documentation lastmodifiedtime is a mandatory field.

code snippet from ModifyOrder of CMOFSLOPENAPI:

public JSONObject ModifyOrder(Client.ModifyOrderInfo param) throws JSONException {
    m_objErrorlog.WriteIntoLog("SUCCESS", "CMOFSLOPENAPI.java", "ModifyOrder function called");

    try {
        JSONObject l_JsonPostData = new JSONObject();
        l_JsonPostData.put("clientcode", param.clientcode);
        l_JsonPostData.put("uniqueorderid", param.uniqueorderid);
        l_JsonPostData.put("newordertype", param.newordertype);
        l_JsonPostData.put("neworderduration", param.neworderduration);
        l_JsonPostData.put("newquantityinlot", param.newqtyinlot);
        l_JsonPostData.put("newdisclosedquantity", param.newdisclosedqty);
        l_JsonPostData.put("newprice", (double)param.newprice);
        l_JsonPostData.put("newtriggerprice", (double)param.newtriggerprice);
        l_JsonPostData.put("newgoodtilldate", param.newgoodtilldate);
        String l_data = l_JsonPostData.toString();
        JSONObject j_response = validate("ModifyOrder", l_data);
        return j_response;
    } catch (Exception e) {
        m_objErrorlog.WriteIntoLog("FAILED", "CMOFSLOPENAPI.java", "Error in ModifyOrder function");
        JSONObject l_jsonErrorResponse = new JSONObject();
        l_jsonErrorResponse.put("status", "FAILED");
        l_jsonErrorResponse.put("message", e.getMessage());
        l_jsonErrorResponse.put("data", "null");
        return l_jsonErrorResponse;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions