Skip to Content
author's profile photo Former Member
Former Member

Default values in the Event-AfterModify

Hi Expert,

I have 2 questions here.

1) I wanted to set the default values to some of the fields, eg, valid from, to, created by, created at etc, as in the following screen shot. The codes are in the AfterModify. However, the default values will only be appeared after i clicked on the Next button, and not when it first appeared. At the same time, i cant set the default values in the AfterLoading.

2) I wanted to display the Territory name in the field after user selected the Territory in the OVS (screen shot below). I cant seems to get it right with the coding. I suspect the BO "SalesTerritory" may be wrong. Any idea?

\

Thanks in advance.

cheers,

julius

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2015 at 10:23 AM

    Hi Julius,

    I assume, this is a custom BO with a custom GAF, correct?

    Regarding 1 - Initialisation of fields:

    If AfterModify is not working for you, I would alternatively suggest to create a custom action "Initialize" and call it via event handler (BOAction) from the ui after the BO has been created by the BOOperation

    Regarding 2 - display of territory names

    Since this is probably C4C and I do ByDesign, I can't give you a definite answer.

    However:

    How do you access the territory name in the datamodel of the floorplan?

    On the association to the SalesTerritory, you might need to set the loading Type from "Lazy" to "standard" in the UI-Designer.

    Best regards,

    Ludger

    --

    Custom Development with All4Cloud.de

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Ludger,

      Thanks Ludger, question 1 is solved by creating the custom action and called by a BOAction which is preceded by the BOOperation create.

      For the question 2, the territory is an OVS field from the public OVS, as below. I'm not sure the loading type is the problem because from the debugging, there is no return from the query. Therefore i'm not sure BO SalesTerritory is the correct BO.

      cheers,

      julius

  • Posted on Oct 14, 2015 at 08:24 AM

    Hello Julius,

    You can default fixed values in the BO code.

    E.g.:

    element MyID : ID = "Hugo";

    element MyCode : MyCode = MyCode.C0_SOME_CONSTANT;

    element MyName : Name = {languageCode = "EN" };

    HTH,

    Horst

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello Julius,

      As I wrote in my first reply: This works only for fixed values, not for dynamic ones like "today".

      Reg. question 2:

      • If you take "Baden-W├╝rttemberg" you should map it to the query parameter "Name"
      • If you take "9" you should map it to the query parameter "ID"

      HTH,

      Horst

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.