Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Set Color for Item Number in lookup

(0) ShareShare
ReportReport
Posted on by 225

Hi,

Is it possible to set a color scheme in the item number lookup window? e.g. every item number that display in every line have different font color. Thanks in advance.

 Lexter

*This post is locked for comments

  • Lexter Tan Profile Picture
    Lexter Tan 225 on at
    Re: Re: Re: Re: Re: Re: Set Color for Item Number in lookup

    Hi David,

    No worries... thanks a lot!

     

    Regards,

    Lexter

  • winthropdc Profile Picture
    winthropdc on at
    Re: Re: Re: Re: Re: Set Color for Item Number in lookup

    Hi Lexter

    This looks fine.

    I am not sure why it is not working for you properly.

    David

    PS: the warning for the second trigger needs to be update to say PRE

     

    David Musgrave [MSFT]
    Escalation Engineer - Microsoft Dynamics GP
    Microsoft Dynamics Support - Asia Pacific

    Microsoft Dynamics (formerly Microsoft Business Solutions)
    http://www.microsoft.com/Dynamics

    mailto:David.Musgrave@online.microsoft.com
    http://blogs.msdn.com/DevelopingForDynamicsGP

    Any views contained within are my personal views and not necessarily Microsoft policy.
    This posting is provided "AS IS" with no warranties, and confers no rights. 

  • Lexter Tan Profile Picture
    Lexter Tan 225 on at
    Re: Re: Re: Re: Set Color for Item Number in lookup

    Hi David

    li_result = Trigger_RegisterFocus(anonymous(window IV_Item_Number_Scroll of form IV_Item_Number_Lookup),
      TRIGGER_FOCUS_FILL, TRIGGER_AFTER_ORIGINAL, script Color_Trig_IV_Item_Number_Lookup_SCROLL_FILL);
    if li_result <> SY_NOERR then warning "Focus trigger for Color_Trig_IV_Item_Number_Lookup_SCROLL_FILL failed."; end if;

    li_result = Trigger_RegisterFocus(anonymous(window IV_Item_Number_Scroll of form IV_Item_Number_Lookup),
      TRIGGER_FOCUS_PRE, TRIGGER_AFTER_ORIGINAL, script Color_Trig_IV_Item_Number_Lookup_SCROLL_FILL);
    if li_result <> SY_NOERR then warning "Focus trigger for Color_Trig_IV_Item_Number_Lookup_SCROLL_FILL failed."; end if;
     

    local boolean result;

    default form to IV_Item_Number_Lookup;
    default window to IV_Item_Number_Scroll;

    if 'Item Number' of table IV_Item_MSTR = "-2001" or 'Item Number' of table IV_Item_MSTR = "-5414" then
     result = Field_SetFontColor('Item Number', COLOR_RED);
    else
     result = Field_SetFontColor('Item Number', COLOR_BLUE);
    end if;

  • winthropdc Profile Picture
    winthropdc on at
    Re: Re: Re: Set Color for Item Number in lookup

    Hi Lexter

    Please can you post the scripts you are using?

    Thanks

    David 

    David Musgrave [MSFT]
    Escalation Engineer - Microsoft Dynamics GP
    Microsoft Dynamics Support - Asia Pacific

    Microsoft Dynamics (formerly Microsoft Business Solutions)
    http://www.microsoft.com/Dynamics

    mailto:David.Musgrave@online.microsoft.com
    http://blogs.msdn.com/DevelopingForDynamicsGP

    Any views contained within are my personal views and not necessarily Microsoft policy.
    This posting is provided "AS IS" with no warranties, and confers no rights. 

  • Lexter Tan Profile Picture
    Lexter Tan 225 on at
    Re: Re: Set Color for Item Number in lookup

    Hi David,

     i used the TRIGGER_AFTER_ORIGINAL. the problem is upon loading it is not populated with proper color and the color of the scrolling window for fonts is the one defaulted.

     

    Thanks!

    Lexter

  • winthropdc Profile Picture
    winthropdc on at
    Re: Set Color for Item Number in lookup

    But what does the trigger registration in the Startup procedure say?

    TRIGGER_AFTER_ORIGINAL or TRIGGER_BEFORE_ORIGINAL

    David Musgrave [MSFT]
    Escalation Engineer - Microsoft Dynamics GP
    Microsoft Dynamics Support - Asia Pacific

    Microsoft Dynamics (formerly Microsoft Business Solutions)
    http://www.microsoft.com/Dynamics

    mailto:David.Musgrave@online.microsoft.com
    http://blogs.msdn.com/DevelopingForDynamicsGP

    Any views contained within are my personal views and not necessarily Microsoft policy.
    This posting is provided "AS IS" with no warranties, and confers no rights. 

     

  • Lexter Tan Profile Picture
    Lexter Tan 225 on at
    Re: Re: Re: Re: Re: Re: Set Color for Item Number in lookup

    Hi David,

    I am sure because i am logging the script and doing it in test mode. Thanks.

     

     Lexter

  • winthropdc Profile Picture
    winthropdc on at
    Re: Re: Re: Re: Re: Set Color for Item Number in lookup

    Hi Lexter

    Are you making sure your code runs after the original scripts?

    David Musgrave [MSFT]
    Escalation Engineer - Microsoft Dynamics GP
    Microsoft Dynamics Support - Asia Pacific

    Microsoft Dynamics (formerly Microsoft Business Solutions)
    http://www.microsoft.com/Dynamics

    mailto:David.Musgrave@online.microsoft.com
    http://blogs.msdn.com/DevelopingForDynamicsGP

    Any views contained within are my personal views and not necessarily Microsoft policy.
    This posting is provided "AS IS" with no warranties, and confers no rights. 

  • Lexter Tan Profile Picture
    Lexter Tan 225 on at
    Re: Re: Re: Re: Set Color for Item Number in lookup

    Hi David,

    Thanks for the quick response, but i tried that also but it does'nt work.  The problem is when the fill script triggers it just display original colour, i still need to use the arrow keys to move up or down so the color of each line will change. Any advice? thanks a lot.

     

    local boolean result;

    result = Field_SetFontColor('Item Number' of window IV_Item_Number_Scroll, COLOR_RED);

     

  • winthropdc Profile Picture
    winthropdc on at
    Re: Re: Re: Set Color for Item Number in lookup

    Hi Lexter

    I believe the triggers are needed after the LINE_FILL and LINE_PRE events.

    David Musgrave [MSFT]
    Escalation Engineer - Microsoft Dynamics GP
    Microsoft Dynamics Support - Asia Pacific

    Microsoft Dynamics (formerly Microsoft Business Solutions)
    http://www.microsoft.com/Dynamics

    mailto:David.Musgrave@online.microsoft.com
    http://blogs.msdn.com/DevelopingForDynamicsGP

    Any views contained within are my personal views and not necessarily Microsoft policy.
    This posting is provided "AS IS" with no warranties, and confers no rights. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans