I am trying to retrieve form information using the Initial SQL Render/Data Bind option in Module Configuration. I have a stored procedure which works with known UserId numbers, to retrieve the values for the form, and I have presently called the stored procedure in the Bind option as follows:-
exec CoreDb.dbo.GetPersonalProfile $(UserID), '$(Username)', '$(Firstname)', '$(Lastname)', $(ProfileId), $(HighFibre), $(MedFibre), $(LowSatFat), $(LowSalt), $(HighSalt), $(GlutenFree), $(MilkFree), $(Artif), $(Kosher), $(FairTrade), $(Organic), $(Halal), $(Vegan), $(Vege)
The corresponding stored procedure has a parameter setup of:-
ALTER PROCEDURE [dbo].[GetPersonalProfile]
-- Add the parameters for the stored procedure here
@Userid int,
@Username nvarchar(255),
@FirstName nvarchar(255),
@LastName nvarchar(255),
@Profileid int OUT,
@HighFibre bit OUT,
@MedFibre bit OUT,
@LowSatFat bit OUT,
@LowSalt bit OUT,
@HighSalt bit OUT,
@GlutenFree bit OUT,
@MilkFree bit OUT,
@Artif bit OUT,
@Kosher bit OUT,
@FairTrade bit OUT,
@Organic bit OUT,
@Halal bit OUT,
@Vegan bit OUT,
@Vege bit OUT
AS
...
In my form, I have a hidden field for ProfileId, no fields defined for UserId, and Fields for the rest with short field names as expressed in the Bind option (e.g. $(Username) has a field with a shortname Username, $(HighFibre) has a check box field with short name HighFibre.
When the form loads with a valid User, which I know has valid form values, as I use a stored procedure which does work on submission of the form, I only get the Username, Firstname, and Lastname filled in the form. That is to say no checkboxes checked when they should be checked. Running the stored procedure in SQL Management Studio returns bits set for the User correctly.
Can anyone tell me what I am doing wrong? Much obliged in advance.