Skip to Content

Error while creating a Sales Quote via ABSL


Hello Colleague ,

Form our Custom BO screens we are trying to create a sales quote on the press of button . We have written the code shown below but when the code is executed and save is done we are getting errors like "Please enter a party will role Account" , "Please enter a party with seller" etc (as shown in the attachment) .We are passing all these values in our code . Interestingly the save happens even with errors and when we open the created quote all account ,seller party , product are populated correctly and there is no error.

Can anyone help how to remove these errors or how we can dynamically suppress these unwanted error messages via SDK code .

Thanks in advance.

Code used to create sales Quote .>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

var CustomerQuote_Root: elementsof CustomerQuote;

var InstCustomerQuote;
var CustomerQuote_Item:elementsof CustomerQuote.Item;

var InstCustomerQuote_Item;


//Customer Quote: maintain business object type


CustomerQuote_Root.TypeCode = "30";


CustomerQuote_Root.Name.content = "Project";

//Customer Quote : maintaine External Referance

CustomerQuote_Root.BuyerID.content= "From Project " + this.OpportunityID.RemoveLeadingZeros();

//Customer Quote : Create new Instance

InstCustomerQuote = CustomerQuote.Create( CustomerQuote_Root );

InstCustomerQuote.ProjectID = this.OpportunityID.RemoveLeadingZeros();


//Customer Quote : Maintain Buyer party

InstCustomerQuote.BuyerParty.PartyKey.PartyID.content = account.AccountID.content.RemoveLeadingZeros();


// maintain Sales Unit

var salesUnitInstance = InstCustomerQuote.SalesUnitParty.Create();

salesUnitInstance.PartyKey.PartyID.content = this.SalesUint.content;

........

Error.JPG (31.4 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on May 14, 2015 at 09:58 AM

    Hello Saurabh,


    Here in your code you are creating CustomerQuote instance before than assigning Sales unit and sales unit, you can try below code.

    On creation of instance it is validating and error messages are raised.


    var CustomerQuote_Root: elementsof CustomerQuote;

    var InstCustomerQuote;
    var CustomerQuote_Item:elementsof CustomerQuote.Item;

    var InstCustomerQuote_Item;

    var CustomerQuote_SalesUnit:elementsof CustomerQuote.SalesUnitParty;


    //Customer Quote: maintain business object type


    CustomerQuote_Root.TypeCode = "30";


    CustomerQuote_Root.Name.content = "Project";

    //Customer Quote : maintaine External Referance

    CustomerQuote_Root.BuyerID.content= "From Project "+this.OpportunityID.RemoveLeadingZeros();


    CustomerQuote_Root.ProjectID = this.OpportunityID.RemoveLeadingZeros();

    //Customer Quote : Maintain Buyer party

    CustomerQuote_Root.BuyerParty.PartyKey.PartyID.content=account.AccountID.content.RemoveLeadingZeros();


    //Customer Quote : Create new Instance

    InstCustomerQuote = CustomerQuote.Create( CustomerQuote_Root );



    // maintain Sales Unit

    CustomerQuote_SalesUnit.PartyKey.PartyID.content = this.SalesUint.content;

    var salesUnitInstance = InstCustomerQuote.SalesUnitParty.Create(CustomerQuote_SalesUnit);

    And do the similar thing for Item also, first assign all mandatory value and then use Create statement.


    Hope this will help.


    Regard

    Sunil Maurya

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.